import { Space } from 'antd';
import { DataType } from '../constant';

interface Props {
  record: DataType;
  readAccessKey: (record: DataType) => void;
  disableAccessKey: (record: DataType) => void;
}

export default function Operation({
  record,
  readAccessKey,
  disableAccessKey,
}: Props) {
  return (
    <Space size="middle">
      {record.disable === 0 ? (
        <>
          <a onClick={() => readAccessKey(record)}>查看</a>
          <a onClick={() => disableAccessKey(record)} className={'dangerBtn'}>
            禁用
          </a>
        </>
      ) : (
        <>--</>
      )}
    </Space>
  );
}
